package com.si.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.si.dao.EntityDao;
import com.si.entity.SysUser;
import com.si.entity.User;

/**
 * 标签
 * @author Administrator
 *
 */
@Service
public class UserService extends BaseService<User>{

	@Autowired
	private EntityDao entityDao ;
	 /**
	 * 通过用户名和密码查询
	 * 
	 * @param userName
	 * @param passWord
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public User loginUser(String userName, String passWord) {
		User user = null;
		Map<String, Object> queryMap = new HashMap<String, Object>();
		queryMap.put("userName", userName);
		queryMap.put("passWord", passWord);
		List<User> list = (List<User>) entityDao.createCriteria(User.class, queryMap, null);
		if (list != null && list.size() > 0) {
			user = list.get(0);
		}
		return user;
	}
}
